package internal

import (
	"api/global"
	__ "api/proto"
	"api/request"
	"github.com/gin-gonic/gin"
	"net/http"
)

func Address(c *gin.Context) {

	var form request.Address
	if err := c.ShouldBind(&form); err != nil {
		c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
		return
	}

	address, _ := global.PetClient.Address(c, &__.AddressListRep{})

	c.JSON(http.StatusOK, gin.H{
		"message": "成功",
		"data":    address,
		"code":    200,
	})

}
